Skip to content

Redesign the asset rows on the create offer page - #1007

Open
Rigidity wants to merge 3 commits into
rigidity/redesign-create-offer-cardsfrom
rigidity/redesign-offer-asset-rows
Open

Rigidity wants to merge 3 commits into
rigidity/redesign-create-offer-cardsfrom
rigidity/redesign-offer-asset-rows

Conversation

@Rigidity

@Rigidity Rigidity commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Follows #1006, which redesigned the rest of the create offer page. This PR does the asset rows inside the "You offer" and "You request" cards.

  • One bordered row per asset. The amount comes first, then the asset, with the remove button inside the row. Tokens read as "100 · SBD" rather than "SBD · 100".

  • Spendable balance under each offered token. For example, "500 SBD spendable". If the amount is more than that, the row turns red and says so. For XCH, the limit counts the network fee, the same as the Max button.

  • "Max" text button. It replaces the up-arrow icon and fills in the same amount as before.

  • Requested NFT lookup. After you paste an NFT ID, the row shows one of:

    • "This isn't a valid NFT ID." for anything that isn't an nft1… ID
    • "Looking up NFT…"
    • its name (or "NFT found" until the name is known) and the Mutable badge if its metadata can change
    • "Couldn't find this NFT…" if it doesn't exist or no peer is connected

    The lookup uses the existing getNftMetadataUpdater network lookup, which is the same one the confirmation dialog uses. No new endpoint is added.

  • Removed the "Tokens", "NFTs" and "Options" sub-headings. These weren't translated. Each row's selector already shows what kind of asset it is.

  • Removed the per-row z-index workaround. The dropdowns render in a portal, so it wasn't needed.

  • "Part of an open offer" warning. For NFTs and options, this is now a line of text under the row instead of an icon you had to hover over.

A pasted ID is stored without surrounding spaces or newlines. Emptying the field, or typing something that isn't an NFT ID, updates the preview immediately.

What gets offered is unchanged. The over-balance message is a warning only and doesn't block creating the offer, the same as before. I created an offer end to end in the sandbox: two tokens and two NFTs offered, a token and someone else's NFT requested.

Review

Two review rounds, each run with separate correctness, tests and simplification reviewers. Round 1 found that the thumbnail never appears for an NFT the wallet doesn't hold. getNftThumbnail reads only NFTs whose coin the wallet holds, and a requested NFT usually belongs to someone else. So the preview no longer shows a thumbnail; see the decision below. Other fixes:

  • Trim pasted IDs.
  • Clear a stale preview straight away.
  • Tests for the lookup's debounce and late results, the preview's states, amounts at the spendable balance, the fee only counting against XCH, and requested tokens showing no balance or Max.

Round 2 found nothing at major or above.

Decisions to confirm

  • No thumbnail in the requested NFT preview. Showing one, and refreshing the name once the NFT's metadata downloads, needs a backend change: for example, returning the saved asset's icon and name from the lookup for an NFT the wallet doesn't hold.
  • No royalty in the NFT preview. No existing endpoint returns a requested NFT's royalty, so showing it would need a new RPC endpoint.
  • Over-balance is a warning, not a block. The Create Offer button stays enabled, as it was before.
  • New wording for the row messages above.

New strings are wrapped with Lingui; the next release needs pnpm extract.

@Rigidity
Rigidity added this pull request to stack #1008 November 15, 2026 00:44
@Rigidity
Rigidity marked this pull request as ready for review November 15, 2026 00:44
@Rigidity
Rigidity force-pushed the rigidity/redesign-offer-asset-rows branch from 2a4c6a2 to 17ab8f7 Compare November 15, 2026 04:29
- Put each asset's inputs in one bordered row, amount before asset, with the remove button inside it
- Show the spendable balance under each offered token, and flag an amount above it
- Look up requested NFT IDs and show what was found, or why nothing was
- Drop the Tokens, NFTs and Options sub-headings and the per-row z-index workaround
- Show the open-offer warning for NFTs and options as text under the row
- Drop the requested NFT's thumbnail, which never loads: the wallet only
  keeps images for NFTs it holds. Show "NFT found" until the name is
  known, rather than calling a named NFT unnamed
- Store a pasted NFT ID without surrounding whitespace, since the offer
  would reject it after the preview said it was found
- Reuse the row footer for the found preview
- Test the lookup's debounce and that a late result is ignored, the
  preview's states, amounts at the spendable balance, the fee only
  counting against XCH, and the empty message
Emptying the field or breaking the ID kept the previous NFT's preview up
until the debounce caught up. Neither needs a lookup, so show them at
once. Also test that requested tokens show no balance or Max.
@Rigidity
Rigidity force-pushed the rigidity/redesign-offer-asset-rows branch from 17ab8f7 to 4bb1450 Compare November 15, 2026 05:12

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant